import 'package:flutter/material.dart';

class SecondPage extends StatefulWidget {
  SecondPage({Key key}) : super(key: key);

  @override
  _SecondPageState createState() => _SecondPageState();
}

class _SecondPageState extends State<SecondPage> with AutomaticKeepAliveClientMixin{

   @override
  void initState() { 
    super.initState();
    debugPrint("second");
  }
  @override
  Widget build(BuildContext context) {
    super.build(context);
    return Container(
      child: Center(
         child: Text("这是第二页"),
       ),
    );
  }
  @override
  bool get wantKeepAlive=>true;
}